﻿@inject RentInfoDataService RentInfoDataService
@inject IRentInfoDataProvider RentInfoDataProvider
<div class="demo-description mw-1100">
    <h2><DemoNavLink Link="BindGridtoData#LargeData" />Large Datasets</h2>
    <p>
        In this demo, the DevExpress Blazor <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxDataGrid-1">Data Grid</a> is bound to a data collection with over a million rows (1GB+ in overall size). Navigate between grid pages, sort data, or filter data to experience our Blazor DataGrid’s responsiveness and performance capabilities when binding to large datasets.
    </p>
    <p>
        You can use any of the ways demonstrated above (the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxDataGrid-1.Data">Data</a>, <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxDataGrid-1.DataAsync">DataAsync</a>, or <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxDataGrid-1.CustomData">CustomData</a> property) to bind the grid to a large data collection. The collection must implement the <a class="helplink" target="_blank" href="https://docs.microsoft.com/en-us/dotnet/api/system.linq.iqueryable-1">IQueryable&lt;T&gt;</a> interface. This demo uses the <b>DataAsync</b> property and Entity Framework Core.
    </p>
</div>
<DataProviderAccessAreaContainer DataProvider="@RentInfoDataProvider">
    <DxDataGrid DataAsync="@RentInfoDataService.GetQueryableAreaRentInfo"
                PageSize="10"
                ShowFilterRow="true"
                KeyFieldName="Oid"
                CssClass="mw-1100">
        <DxDataGridColumn Field="@nameof(AreaRentInfo.State)"></DxDataGridColumn>
        <DxDataGridColumn Field="@nameof(AreaRentInfo.Area)"></DxDataGridColumn>
        <DxDataGridColumn Field="@nameof(AreaRentInfo.City)" Caption="County"></DxDataGridColumn>
        <DxDataGridColumn Field="@nameof(AreaRentInfo.Name)" Caption="Location"></DxDataGridColumn>
        <DxDataGridSpinEditColumn Field="@nameof(AreaRentInfo.Year)"></DxDataGridSpinEditColumn>
        <DxDataGridSpinEditColumn Field="@nameof(AreaRentInfo.Bedrooms)"></DxDataGridSpinEditColumn>
        <DxDataGridSpinEditColumn Field="@nameof(AreaRentInfo.Rent)">
            <DisplayTemplate>
                @(((context as AreaRentInfo).Rent).ToString("C2"))
            </DisplayTemplate>
        </DxDataGridSpinEditColumn>
        <DxDataGridSpinEditColumn Field="@nameof(AreaRentInfo.Population)">
            <DisplayTemplate>
                @(((context as AreaRentInfo).Population).ToString("#,0"))
            </DisplayTemplate>
        </DxDataGridSpinEditColumn>
    </DxDataGrid>

    <CodeSnippet_GridLargeDataBase></CodeSnippet_GridLargeDataBase>
</DataProviderAccessAreaContainer>
